Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Rendered β€’ View raw β€’ Download

feature/car/README.md fix/fdroid-map-rendering (113121c4) Text, 3.83 KB

T383838:feature:car

Overview

The T383838:feature:car module provides the Android Auto integration built on T383838androidx.car.app. T383838MeshtasticCarAppService is a T383838CarAppService registered in the MESSAGING category (T383838androidx.car.app.category.MESSAGING); each host connection gets a T383838MeshtasticCarSession that wires up state, alerts, and conversation shortcuts.

Target: Android only, T383838google flavor only β€” the module is added via T383838googleImplementation(projects.feature.car) in T383838:androidApp, and T383838FeatureCarModule is included from the google flavor's T383838FlavorModule.

Templates Gating

Production ships notification-only Android Auto messaging (MessagingStyle notifications + T383838ConversationShortcutManager). The full templated car app is gated:

β€’ Build with T383838-PenableCarTemplates=true to enable it (Internal/Closed Play tracks only).
β€’ The Gradle property resolves the T383838carTemplatesEnabled manifest placeholder β€” in this module's own T383838build.gradle.kts/T383838AndroidManifest.xml (a library resolves its own placeholders; the app's value does not override it) and again in T383838:androidApp as defense-in-depth.
β€’ The decisive host-side gate is T383838automotive_app_desc's T383838<uses name="template" />; the T383838android:enabled="${carTemplatesEnabled}" service flag keeps the templated service unbindable in production.

Key Components

Service layer (T383838service/)

β€’ T383838MeshtasticCarAppService β€” T383838CarAppService; host validation (allowlist in release, T383838ALLOW_ALL_HOSTS_VALIDATOR in debug), creates sessions.
β€’ T383838MeshtasticCarSession β€” per-connection T383838Session; starts T383838CarStateCoordinator, T383838EmergencyHandler, and T383838ConversationShortcutManager, tags the session in Crashlytics, and returns the first T383838Screen.
β€’ T383838CarStateCoordinator β€” bridges repository flows (nodes, messages, connection state) into car presentation state (T383838MessageSnapshot, T383838NodeUi in T383838model/CarUiModels.kt). Created per car session.
β€’ T383838ConversationShortcutManager β€” publishes dynamic shortcuts for active DMs/channels so Android Auto surfaces Meshtastic conversations and links notifications to conversations via T383838LocusIdCompat (the notification/reply plumbing that also serves the notification-only production path).

Screens (T383838screens/)

β€’ T383838HomeScreen β€” T383838TabTemplate dashboard (messages / nodes / status tabs) fed by T383838CarStateCoordinator.
β€’ T383838NodeDetailScreen β€” T383838PaneTemplate detail for one node (signal, battery, last heard) with a message action.

Emergency alerts (T383838alerts/)

β€’ T383838EmergencyHandler β€” observes incoming T383838PortNum.ALERT_APP packets, maintains the active T383838EmergencyAlert list, and triggers audio tones on the car head unit.

Util layer (T383838util/)

β€’ T383838MessageFilter β€” decides which packets are displayable (text, non-blank, not emoji-only) and validates outgoing message byte length.
β€’ T383838CarScreenDataBuilder β€” pure functions converting domain models to car UI models; free of Car App Library types so they unit-test without Robolectric.
β€’ T383838NodeSubtitleFormatter β€” node subtitle text with signal colouring and responsive variants.
β€’ T383838PersonIconFactory β€” circular initial avatars for T383838Person icons in MessagingStyle notifications and shortcut avatars.
β€’ T383838CrashlyticsCarTagger β€” sets the T383838car_session Crashlytics custom key.

Key Dependencies

From T383838feature/car/build.gradle.kts:

β€’ T383838core:common, T383838core:data, T383838core:database, T383838core:domain, T383838core:model, T383838core:repository
β€’ T383838androidx.car.app, T383838androidx.car.app.projected (+ T383838androidx.car.app.testing for tests)
β€’ T383838koin.android, T383838firebase.crashlytics (via Firebase BoM), T383838kermit

Testing

Screen and flow tests run on the JVM via T383838TestCarContext + mokkery + Robolectric (T383838CarScreensTest) β€” the Desktop Head Unit cannot drive current Car App API levels. See TESTING.md for the full recipe.

Served by rngit 1.5.0 - Generated in 0.03s